package com.hukun.adpter;
//111111111111111111111111111111111
import com.sun.scenario.effect.impl.sw.sse.SSEBlend_SRC_OUTPeer;

public class Test {
    public static void main(String[] args) {
        //传统方式  你要实现接口的全部方法
        Opertor opertor1 = new Opertor(new Inter() {
            @Override
            public void A() {
                System.out.println("手机充电");
            }

            @Override
            public void B() {

            }

            @Override
            public void C() {

            }

            @Override
            public void d() {

            }

            @Override
            public void e() {
                System.out.println("耳机充电");
            }
        });

        opertor1.charge();
        opertor1.erjicharge();
       //使用适配器模式只需要实现你需要的方法
        Opertor mobileopertor = new Opertor(new DefaultUsb() {
            @Override
            public void A() {
                System.out.println("手机充电");

            }

            @Override
            public void e() {
                System.out.println("耳机充电");
            }

        });

        mobileopertor.charge();
        mobileopertor.erjicharge();

       //专门写一个实现类的方式  都可 看个人习惯
        MobileUsb mobileUsb = new MobileUsb();
        mobileUsb.A();
        mobileUsb.e();
    }


}
